# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-beautifultable
pkgname=('python2-beautifultable' 'python-beautifultable')
_pkgname=beautifultable
pkgver=1.1.0
pkgrel=4
pkgdesc='Print ASCII tables for terminals.'
arch=('any')
url='https://pypi.org/project/beautifultable/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('662b51d84c3ed10e287ce01511d0b920e184d558e49a1a0dab3add954f717fdb8868a8a05e32591096777a36274b0c3e0c4d50a6ccd0440c6f404fd2ae10eb3d')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-beautifultable() {
  depends=('python2' 'python2-enum34')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-beautifultable() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

